home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _gcurcol.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  1KB  |  65 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef PDCDEBUG
  5. char *rcsid__gcurcol = "$Header: C:\CURSES\private\RCS\_gcurcol.c 2.1 1993/06/18 20:23:20 MH Rel MH $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_get_cur_col()    - get current column position of cursor
  14.  
  15.   PDCurses Description:
  16.      This is a private PDCurses function
  17.  
  18.      This routine returns the current column position of the cursor on
  19.      screen.
  20.  
  21.   PDCurses Return Value:
  22.      This routine returns the current column position of the cursor. No
  23.      error is returned.
  24.  
  25.   PDCurses Errors:
  26.      There are no defined errors for this routine.
  27.  
  28.   Portability:
  29.      PDCurses    int    PDC_get_cur_col( void );
  30.  
  31. **man-end**********************************************************************/
  32.  
  33. int    PDC_get_cur_col(void)
  34. {
  35. #ifdef    OS2
  36.     USHORT curCol, curRow;
  37. #endif
  38.  
  39. #ifdef PDCDEBUG
  40.     if (trace_on) PDC_debug("PDC_get_cur_col() - called\n");
  41. #endif
  42.  
  43. #ifdef    FLEXOS
  44.     retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
  45.     return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
  46. #endif
  47.  
  48. #ifdef    DOS
  49.     regs.x.ax = 0x0003;
  50.     regs.h.bh = _cursvar.video_page;
  51.     int86(0x10, ®s, ®s);
  52.     return((int) regs.h.dl);
  53. #endif
  54.  
  55. #ifdef    OS2
  56.     /* find the current cursor position */
  57.     VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
  58.     return (curCol);
  59. #endif
  60.  
  61. #ifdef UNIX
  62. /* INCOMPLETE */
  63. #endif
  64. }
  65.